<?php
//
// Book Class
// The SDMworld! Network
//

class cObj65cd3f08dc8f11db83140800200c9a66 extends cDycmsObject
{
	protected $mClsId = '65cd3f08dc8f11db83140800200c9a66';
	
	private $mTitle;
	private $mAbstract;
	
	function Render(IDycmsClient &$r_client)
	{
		global $gViewerUrl;
		
		$r_client->ContentNode()->AddChild(new cUiPageHeader("<h1>{$this->mTitle}</h1>"));
		
		//
		// Create content holder node
		//
		
		$r_client->ContentNode()->AddChild($page = new cUiPageBody());
		
		$page->AddChild(new cHtmlCode($this->mAbstract));
		
		
		//
		// Get book contents
		//
		
		$query = new cDycmsQuery("obj-parent:".$this->mId);
		$query->SetClass(STDCLS_CHAPTER);
		$n = $query->Execute();
		
		//
		// Add module for book contents
		//
		
		$r_client->AddModule($conts = new cDycmsClientModule(uiGetIcon('report')." Contents"));
		
		for ($i = 0; $i < $n; $i++)
		{
			$conts->AddChild(new cHtmlCode($query->mObject->GetSummary($i)));
		};
	}
	
	function GetSummary()
	{
		return $this->mTitle;
	}
	
	function LoadObject()
	{
		$this->mSummaryValue['title'] = true;
		
		$this->mTitle = &$this->mAttributes['title'];
		$this->mAbstract = &$this->mAttributes['abstract'];
	}
	
	function GetAttributes($bVals)
	{
		if($bVals)
		{
			
		}
		else
		{
			return array('title');
		};
	}
}

?>